using IcsSEMCtrl.Util;
using System;
namespace Lifter.Global.Device
{
    [Serializable]
    public class VehicleOperationMode
    {
        public const int _SINGLE_CAGE = 0;
        public const int _DUAL_CAGE = 1;
        public const int _DUAL_VEHICLE = 2;
        private int _value;
        public static int _size;
        private static VehicleOperationMode[] _array;
        public static string[] displayStrings;
        public static VehicleOperationMode[] displayValues;
        public static VehicleOperationMode SINGLE_CAGE;
        public static VehicleOperationMode DUAL_CAGE;
        public static VehicleOperationMode DUAL_VEHICLE;
        public static VehicleOperationMode IT_ENUM_MAX;
        static VehicleOperationMode()
        {
            VehicleOperationMode._size = 3;
            VehicleOperationMode._array = new VehicleOperationMode[VehicleOperationMode._size];
            VehicleOperationMode.displayStrings = new string[VehicleOperationMode._size];
            VehicleOperationMode.displayValues = new VehicleOperationMode[VehicleOperationMode._size];
            VehicleOperationMode.SINGLE_CAGE = new VehicleOperationMode(0);
            VehicleOperationMode.DUAL_CAGE = new VehicleOperationMode(1);
            VehicleOperationMode.DUAL_VEHICLE = new VehicleOperationMode(2);
            VehicleOperationMode.IT_ENUM_MAX = new VehicleOperationMode(2147483647);
            VehicleOperationMode.displayStrings[0] = "SINGLE_CAGE";
            VehicleOperationMode.displayStrings[1] = "DUAL_CAGE";
            VehicleOperationMode.displayStrings[2] = "DUAL_VEHICLE";
            VehicleOperationMode.displayValues[0] = VehicleOperationMode.SINGLE_CAGE;
            VehicleOperationMode.displayValues[1] = VehicleOperationMode.DUAL_CAGE;
            VehicleOperationMode.displayValues[2] = VehicleOperationMode.DUAL_VEHICLE;
        }
        public static string ValueToString(VehicleOperationMode val)
        {
            string result;
            switch (val.Value())
            {
                case 0:
                    result = VehicleOperationMode.displayStrings[0];
                    break;
                case 1:
                    result = VehicleOperationMode.displayStrings[1];
                    break;
                case 2:
                    result = VehicleOperationMode.displayStrings[2];
                    break;
                default:
                    result = "";
                    break;
            }
            return result;
        }
        public static VehicleOperationMode StringToValue(string val)
        {
            VehicleOperationMode result;
            if (Helper.IsNullOrEmpty(val))
            {
                result = VehicleOperationMode.IT_ENUM_MAX;
            }
            else
            {
                for (int i = 0; i < VehicleOperationMode.displayStrings.Length; i++)
                {
                    if (val.Equals(VehicleOperationMode.displayStrings[i]))
                    {
                        result = VehicleOperationMode.displayValues[i];
                        return result;
                    }
                }
                result = null;
            }
            return result;
        }
        public int Value()
        {
            return this._value;
        }
        public static VehicleOperationMode From_Int(int value)
        {
            VehicleOperationMode result;
            if (value >= 0 && value < VehicleOperationMode._size)
            {
                result = VehicleOperationMode._array[value];
            }
            else
            {
                result = VehicleOperationMode.IT_ENUM_MAX;
            }
            return result;
        }
        protected VehicleOperationMode(int value)
        {
            this._value = value;
            if (value >= 0 && value < VehicleOperationMode._size)
            {
                VehicleOperationMode._array[this._value] = this;
            }
        }
        public bool Equals(VehicleOperationMode otherEnum)
        {
            return otherEnum.Value() == this._value;
        }
        public override string ToString()
        {
            return VehicleOperationMode.displayStrings[this._value];
        }
    }
}
